import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '所属项目',
    align: "center",
    dataIndex: 'projectNum_dictText'
  },
  {
    title: '姓名',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '身份证号码',
    align: "center",
    dataIndex: 'certNum'
  },
  {
    title: '电话号码',
    align: "center",
    dataIndex: 'phoneNum'
  },
  {
    title: '地址',
    align: "center",
    dataIndex: 'address'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '所属项目',
    field: 'projectNum',
    component: 'JDictSelectTag',
    componentProps:{
      dictCode: "project,project_num,project_num"
    },
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入所属项目!'},
             ];
    },
  },
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入姓名!'},
             ];
    },
  },
  {
    label: '身份证号码',
    field: 'certNum',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入身份证号码!'},
             ];
    },
  },
  {
    label: '电话号码',
    field: 'phoneNum',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入电话号码!'},
             ];
    },
  },
  {
    label: '地址',
    field: 'address',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入地址!'},
             ];
    },
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
